package edu.zut.cs.software.person.staff.domain;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import edu.zut.cs.software.teach.Base.domain.BaseTreeEntity;

/*
 * class for staff category
 * @author liyahui
 */
@Entity
@Table(name="T_STAFFCATEGORY")
@NamedQueries({ @NamedQuery(name = "StaffCategory.getRoot", query = "select m from StaffCategory m where m.parent is null") })
public class StaffCategory extends BaseTreeEntity<StaffCategory, Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/*
	 * name of staff category
	 */
	@Column
	String name;

	/*
	 * position of staff
	 */
	@Column
	String position;
	
	/**
	 * one category of patient relate to Many patients objects
	 */
	@OneToMany(mappedBy = "staffcategory", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	List<Staff> staffs;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

}
